export default class CustomValue2D extends Laya.Value2D {
    vs: string;
    ps: string;
    constructor(vs, ps, subID = new Date().getTime()) {
        // let subID = new Date().getTime();
        super(Laya.ShaderDefines2D.TEXTURE2D, subID);
        this.vs = vs;
        this.ps = ps;
        // 着色器attri参数名称和index对应信息，laya底层会处理这个

    }

    public setAttribLocation(attribLoaction) {
        this._attribLocation = [];
        for (let i = 0; i < attribLoaction.length; i++) {
            this._attribLocation.push(attribLoaction[i][0], i);
        }
        this.shader = new Laya.Shader2X(this.vs, this.ps, Laya.ShaderDefines2D.TEXTURE2D | this.subID, null, this._attribLocation);
    }
}